#include <tcr.cc>

int counter = 0;

int main()
{
	Point a, b, c, d;
	scanf("%d %d %d %d %d %d %d %d", &(a.x), &(a.y), &(b.x), &(b.y), &(c.x), &(c.y), &(d.x), &(d.y));
	a.z = b.z = c.z = d.z = 1;

	if(a.x == 0 && a.y == 0 && b.x == 0 && b.y == 0)
		return 0;

	if(segmentX(a, b, c, d))
		printf("Case %d: YES\n", ++counter);
	else
		printf("Case %d: NO\n", ++counter);

	return main();
}
